package vfs.dao;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.PrimaryKeyJoinColumns;
import javax.persistence.Table;




@Entity
@Table(name = "VFSPATH", schema = "PUBLIC")
public class VFSPath {


    @Id
    private PathKey id;
    private int length;



    public final PathKey getId() { return id; }

    public final void setId(final PathKey id) {
        this.id = id;
    }


    public final int getLength() {
        return length;
    }

    public final void setLength(final int length) {
        this.length = length;
    }

    @ManyToOne
    @PrimaryKeyJoinColumns({
        @PrimaryKeyJoinColumn(name = "ancestor",
                referencedColumnName = "ancestor"),
        @PrimaryKeyJoinColumn(name = "descendant",
                referencedColumnName = "descendant")
    })
    private VFSNode ancestor; /* pointing back to ancestor */
}
